package com.koko.feign;

import com.koko.config.FeignClientConfig;
import com.koko.game.entity.GameDetail;
import com.koko.game.vo.GameCartVO;
import com.koko.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "game-service", url = "http://localhost:8080", configuration = FeignClientConfig.class)
public interface GameFeignService {
    /**
     * 获取购物车上的游戏信息
     * @param id
     * @return
     */
    @GetMapping("/game/cart/{id}")
    Result<GameCartVO> getGameOnCartByGameId(@PathVariable Long id);

    /**
     * 获取游戏详细信息
     * @param gameId
     * @return
     */
    @GetMapping("/game/detail/{gameId}")
    Result<GameDetail> getGameDetailByGameId(@PathVariable Long gameId);
}
